
<template>
    <view class="content">
		<view class="search-box">
			  <u-search 
				placeholder="搜索服务产品" 
				:show-action="false" 
				bg-color="#fff"
				border-color="#eee"
				height="40"
				:animation="false"
				:disabled="true"
				@click="navigateToService"
			  ></u-search>
		</view>
        <!-- data:商品列表数组[{navtitle:标题 shop:展示列表}] @click:商品条目点击事件-->
        <cc-defineCateList :data="data" @itemClick="cateItemClick"></cc-defineCateList>

    </view>
</template>

<script>
	const Odb=uniCloud.importObject('mydb-page')
    export default {
        data() {
            return {
                data: []

            }
        },
        mounted() {
			this.initData()
        },
        methods: {
			initData(){
				Odb.getProducts().then((res)=>{
					this.data=res.data
				})
			},
			navigateToService(path) {
			  uni.navigateTo({
			    url: '/pages/list/search/search'
			  })
			},
            cateItemClick(item) {
				uni.navigateTo({
					url: '/pages/product/list?cid='+item.id
				})
            }

        }
    }
</script>

<style>
    page {
        background-color: #fff;
    }

    .content {
        display: flex;
        flex-direction: column;

    }
	
.search-box {
  padding: 20rpx 30rpx;
}
</style>